<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('指标分析库')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="member-form">
                <div class="select-list">
                    <ul>
                        <li>
                            指标名称：<input type="text" name="targetName"/>
                        </li>
                        <li>
                            指标类型：<select name="targetType">
                            <option value="">请选择</option>
                            <option th:each="targetType : ${targetType}" th:text="${targetType.name}"
                                    th:value="${targetType.id}"></option>
                        </select>
                        </li>
                        <li>
                            指标级别：<select name="targetLevel">
                            <option value="">请选择</option>
                            <option th:each="targetLevel : ${targetLevel}" th:text="${targetLevel.name}"
                                    th:value="${targetLevel.id}"></option>
                        </select>
                        </li>
                        <li>
                            指标生产方：<select name="targetProducers">
                            <option value="">请选择</option>
                            <option th:each="targetProducers : ${targetProducers}" th:text="${targetProducers.name}"
                                    th:value="${targetProducers.id}"></option>
                        </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.addTab()">
                <i class="fa fa-plus"></i> 新增
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.editTab()">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger" onclick="$.operate.removeAll()">
                <i class="fa fa-remove"></i> 删除
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "targetInfo";
    $(function () {
        var options = {
            uniqueId: "targetId",
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            modalName: "指标",
            columns: [{
                checkbox: true
            },
                {
                    field: 'targetNum',
                    title: '指标编号'
                },
                {
                    field: 'targetName',
                    title: '指标名称'
                },
                {
                    field: 'version',
                    title: '版本号'
                },
                {
                    field: 'targetTypeName',
                    title: '指标类型'
                },
                {
                    field: 'targetLevelName',
                    title: '指标级别'
                },
                {
                    field: 'formula',
                    title: '公式'
                },
                {
                    field: 'targetExplain',
                    title: '指标说明'
                },
                {
                    field: 'targetWorth',
                    title: '指标价值'
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>